def selectSort(li):
    n = len(li)
    for i in range(n-1):
        flag = i
        for j in range(i+1,n):
            if li[flag] > li[j]:
                flag = j
        if flag != i:
            li[flag],li[i] = li[i],li[flag]

li = [1,33,23,12,44,5,22,31]
selectSort(li)
for tem in li:
    print(tem)